import { config } from "../config";

class Tools{
  stringToList(str,key){
    console.log(str)
    return str.split(key || ";;")
  }

  listTostring(list,key){
    var str = ""
    list.forEach(element => {
      if (str==="") {
        str = "" + element
      }else{
        str += "," + element
      }
      
    });
    return str
  }

  isCartList(id){
    var isCart = false
    config.cartList.forEach(element => {
      if(element === id){
        isCart = true
      }
    });
    return isCart
  }
}

export {Tools}